<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>矩形</title>



<script>
    function draw() {
        var c = document.getElementById("myCanvas");
        var cxt = c.getContext("2d");
        cxt.stroketyle = "#00FF00";
        cxt.strokeRect(10,20,100,100);
    }
</script>
</head>
<body>
<fieldset>

<legend>
    绘制图形
</legend>
<canvas width="200" height="200" id="myCanvas"
   style="border: 1px solid orangered;"></canvas>
    <p><button type="button" onclick="draw();">绘图</button></p>
</fieldset>

</body>
</html>